3.456 \(\int \frac{\tan ^6(c+d x)}{a+b \tan (c+d x)} \, dx\)

Optimal. Leaf size=154 \[ \frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{a^6 \log (a+b \tan (c+d x))}{b^5 d \left (a^2+b^2\right )}-\frac{b \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac{a x}{a^2+b^2}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d} \]

[Out]

-((a*x)/(a^2 + b^2)) - (b*Log[Cos[c + d*x]])/((a^2 + b^2)*d) + (a^6*Log[a + b*Tan[c + d*x]])/(b^5*(a^2 + b^2)*
d) - (a*(a^2 - b^2)*Tan[c + d*x])/(b^4*d) + ((a^2 - b^2)*Tan[c + d*x]^2)/(2*b^3*d) - (a*Tan[c + d*x]^3)/(3*b^2
*d) + Tan[c + d*x]^4/(4*b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.582818, antiderivative size = 154, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3566, 3647, 3648, 3627, 3617, 31, 3475} \[ \frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{a^6 \log (a+b \tan (c+d x))}{b^5 d \left (a^2+b^2\right )}-\frac{b \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac{a x}{a^2+b^2}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^6/(a + b*Tan[c + d*x]),x]

[Out]

-((a*x)/(a^2 + b^2)) - (b*Log[Cos[c + d*x]])/((a^2 + b^2)*d) + (a^6*Log[a + b*Tan[c + d*x]])/(b^5*(a^2 + b^2)*
d) - (a*(a^2 - b^2)*Tan[c + d*x])/(b^4*d) + ((a^2 - b^2)*Tan[c + d*x]^2)/(2*b^3*d) - (a*Tan[c + d*x]^3)/(3*b^2
*d) + Tan[c + d*x]^4/(4*b*d)

Rule 3566

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m + n - 1)), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3647

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*
tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^m*(c + d
*Tan[e + f*x])^(n + 1))/(d*f*(m + n + 1)), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Tan[e + f*x])^(m - 1)*(c +
d*Tan[e + f*x])^n*Simp[a*A*d*(m + n + 1) - C*(b*c*m + a*d*(n + 1)) + d*(A*b + a*B - b*C)*(m + n + 1)*Tan[e + f
*x] - (C*m*(b*c - a*d) - b*B*d*(m + n + 1))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}
, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] &&  !(IGtQ[n, 0] && ( !Intege
rQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rule 3648

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*
tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m
+ n + 1)), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^n*Simp[a*A*d*(m
+ n + 1) - C*(b*c*m + a*d*(n + 1)) + d*(A*b - b*C)*(m + n + 1)*Tan[e + f*x] - C*m*(b*c - a*d)*Tan[e + f*x]^2,
x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2
, 0] && GtQ[m, 0] &&  !(IGtQ[n, 0] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rule 3627

Int[((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*(A -
 C)*x)/(a^2 + b^2), x] + (Dist[(a^2*C + A*b^2)/(a^2 + b^2), Int[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x],
 x] - Dist[(b*(A - C))/(a^2 + b^2), Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, e, f, A, C}, x] && NeQ[a^2*C + A
*b^2, 0] && NeQ[a^2 + b^2, 0] && NeQ[A, C]

Rule 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\tan ^6(c+d x)}{a+b \tan (c+d x)} \, dx &=\frac{\tan ^4(c+d x)}{4 b d}+\frac{\int \frac{\tan ^3(c+d x) \left (-4 a-4 b \tan (c+d x)-4 a \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{4 b}\\ &=-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}+\frac{\int \frac{\tan ^2(c+d x) \left (12 a^2+12 \left (a^2-b^2\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{12 b^2}\\ &=\frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}+\frac{\int \frac{\tan (c+d x) \left (-24 a \left (a^2-b^2\right )+24 b^3 \tan (c+d x)-24 a \left (a^2-b^2\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{24 b^3}\\ &=-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}+\frac{\int \frac{24 a^2 \left (a^2-b^2\right )+24 \left (a^4-a^2 b^2+b^4\right ) \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{24 b^4}\\ &=-\frac{a x}{a^2+b^2}-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}+\frac{a^6 \int \frac{1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b^4 \left (a^2+b^2\right )}+\frac{b \int \tan (c+d x) \, dx}{a^2+b^2}\\ &=-\frac{a x}{a^2+b^2}-\frac{b \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}+\frac{a^6 \operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^5 \left (a^2+b^2\right ) d}\\ &=-\frac{a x}{a^2+b^2}-\frac{b \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac{a^6 \log (a+b \tan (c+d x))}{b^5 \left (a^2+b^2\right ) d}-\frac{a \left (a^2-b^2\right ) \tan (c+d x)}{b^4 d}+\frac{\left (a^2-b^2\right ) \tan ^2(c+d x)}{2 b^3 d}-\frac{a \tan ^3(c+d x)}{3 b^2 d}+\frac{\tan ^4(c+d x)}{4 b d}\\ \end{align*}

Mathematica [C]  time = 1.75827, size = 167, normalized size = 1.08 \[ \frac{3 b^4 \left (a^2+b^2\right ) \tan ^4(c+d x)-4 a b^3 \left (a^2+b^2\right ) \tan ^3(c+d x)+6 b^2 \left (a^4-b^4\right ) \tan ^2(c+d x)-12 a b \left (a^4-b^4\right ) \tan (c+d x)+6 \left (2 a^6 \log (a+b \tan (c+d x))+b^5 (b+i a) \log (-\tan (c+d x)+i)+b^5 (b-i a) \log (\tan (c+d x)+i)\right )}{12 b^5 d \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^6/(a + b*Tan[c + d*x]),x]

[Out]

(6*(b^5*(I*a + b)*Log[I - Tan[c + d*x]] + b^5*((-I)*a + b)*Log[I + Tan[c + d*x]] + 2*a^6*Log[a + b*Tan[c + d*x
]]) - 12*a*b*(a^4 - b^4)*Tan[c + d*x] + 6*b^2*(a^4 - b^4)*Tan[c + d*x]^2 - 4*a*b^3*(a^2 + b^2)*Tan[c + d*x]^3
+ 3*b^4*(a^2 + b^2)*Tan[c + d*x]^4)/(12*b^5*(a^2 + b^2)*d)

________________________________________________________________________________________

Maple [A]  time = 0.021, size = 179, normalized size = 1.2 \begin{align*}{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{4}}{4\,bd}}-{\frac{a \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{3\,{b}^{2}d}}+{\frac{{a}^{2} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d{b}^{3}}}-{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,bd}}-{\frac{{a}^{3}\tan \left ( dx+c \right ) }{d{b}^{4}}}+{\frac{a\tan \left ( dx+c \right ) }{{b}^{2}d}}+{\frac{b\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,d \left ({a}^{2}+{b}^{2} \right ) }}-{\frac{a\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d \left ({a}^{2}+{b}^{2} \right ) }}+{\frac{{a}^{6}\ln \left ( a+b\tan \left ( dx+c \right ) \right ) }{{b}^{5} \left ({a}^{2}+{b}^{2} \right ) d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^6/(a+b*tan(d*x+c)),x)

[Out]

1/4*tan(d*x+c)^4/b/d-1/3*a*tan(d*x+c)^3/b^2/d+1/2/d/b^3*a^2*tan(d*x+c)^2-1/2*tan(d*x+c)^2/b/d-1/d/b^4*a^3*tan(
d*x+c)+a*tan(d*x+c)/b^2/d+1/2/d/(a^2+b^2)*b*ln(1+tan(d*x+c)^2)-1/d/(a^2+b^2)*a*arctan(tan(d*x+c))+a^6*ln(a+b*t
an(d*x+c))/b^5/(a^2+b^2)/d

________________________________________________________________________________________

Maxima [A]  time = 1.58194, size = 197, normalized size = 1.28 \begin{align*} \frac{\frac{12 \, a^{6} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{5} + b^{7}} - \frac{12 \,{\left (d x + c\right )} a}{a^{2} + b^{2}} + \frac{6 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac{3 \, b^{3} \tan \left (d x + c\right )^{4} - 4 \, a b^{2} \tan \left (d x + c\right )^{3} + 6 \,{\left (a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{2} - 12 \,{\left (a^{3} - a b^{2}\right )} \tan \left (d x + c\right )}{b^{4}}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^6/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(12*a^6*log(b*tan(d*x + c) + a)/(a^2*b^5 + b^7) - 12*(d*x + c)*a/(a^2 + b^2) + 6*b*log(tan(d*x + c)^2 + 1
)/(a^2 + b^2) + (3*b^3*tan(d*x + c)^4 - 4*a*b^2*tan(d*x + c)^3 + 6*(a^2*b - b^3)*tan(d*x + c)^2 - 12*(a^3 - a*
b^2)*tan(d*x + c))/b^4)/d

________________________________________________________________________________________

Fricas [A]  time = 2.44177, size = 417, normalized size = 2.71 \begin{align*} -\frac{12 \, a b^{5} d x - 6 \, a^{6} \log \left (\frac{b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \,{\left (a^{2} b^{4} + b^{6}\right )} \tan \left (d x + c\right )^{4} + 4 \,{\left (a^{3} b^{3} + a b^{5}\right )} \tan \left (d x + c\right )^{3} - 6 \,{\left (a^{4} b^{2} - b^{6}\right )} \tan \left (d x + c\right )^{2} + 6 \,{\left (a^{6} + b^{6}\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 12 \,{\left (a^{5} b - a b^{5}\right )} \tan \left (d x + c\right )}{12 \,{\left (a^{2} b^{5} + b^{7}\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^6/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/12*(12*a*b^5*d*x - 6*a^6*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) - 3*(a^2
*b^4 + b^6)*tan(d*x + c)^4 + 4*(a^3*b^3 + a*b^5)*tan(d*x + c)^3 - 6*(a^4*b^2 - b^6)*tan(d*x + c)^2 + 6*(a^6 +
b^6)*log(1/(tan(d*x + c)^2 + 1)) + 12*(a^5*b - a*b^5)*tan(d*x + c))/((a^2*b^5 + b^7)*d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**6/(a+b*tan(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 4.97714, size = 213, normalized size = 1.38 \begin{align*} \frac{\frac{12 \, a^{6} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{5} + b^{7}} - \frac{12 \,{\left (d x + c\right )} a}{a^{2} + b^{2}} + \frac{6 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac{3 \, b^{3} \tan \left (d x + c\right )^{4} - 4 \, a b^{2} \tan \left (d x + c\right )^{3} + 6 \, a^{2} b \tan \left (d x + c\right )^{2} - 6 \, b^{3} \tan \left (d x + c\right )^{2} - 12 \, a^{3} \tan \left (d x + c\right ) + 12 \, a b^{2} \tan \left (d x + c\right )}{b^{4}}}{12 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^6/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/12*(12*a^6*log(abs(b*tan(d*x + c) + a))/(a^2*b^5 + b^7) - 12*(d*x + c)*a/(a^2 + b^2) + 6*b*log(tan(d*x + c)^
2 + 1)/(a^2 + b^2) + (3*b^3*tan(d*x + c)^4 - 4*a*b^2*tan(d*x + c)^3 + 6*a^2*b*tan(d*x + c)^2 - 6*b^3*tan(d*x +
 c)^2 - 12*a^3*tan(d*x + c) + 12*a*b^2*tan(d*x + c))/b^4)/d